package com.mingsoft.cms.biz.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import com.mingsoft.base.dao.IBaseDao;
import com.mingsoft.basic.biz.impl.BasicBizImpl;
import com.mingsoft.cms.biz.IBasePropertyBiz;
import com.mingsoft.cms.biz.ICompanyBiz;
import com.mingsoft.cms.biz.IInsuranceBiz;
import com.mingsoft.cms.biz.IPropertyValueBiz;
import com.mingsoft.cms.dao.IBasePropertyDao;
import com.mingsoft.cms.dao.ICompanyDao;
import com.mingsoft.cms.dao.IInsuranceDao;
import com.mingsoft.cms.dao.IPropertyValueDao;
import com.mingsoft.cms.entity.ArticleEntity;
import com.mingsoft.cms.entity.InsuranceEntity;
import com.mingsoft.cms.entity.InsurancePriceEntity;
import com.mingsoft.cms.entity.InsurancePropertyEntity;
import com.mingsoft.cms.entity.PropertyValueEntity;

@Service("insuranceImpl")
public class InsuranceBizImpl extends BasicBizImpl implements IInsuranceBiz {

	@Resource(name = "insuranceDao")
	private IInsuranceDao insurance;

	protected IBaseDao getDao() {
		// TODO Auto-generated method stub
		return insurance;
	}
	
	@Override
	public int getCountByColumnId(int[] basicCategoryIds, String flag) {
		if(basicCategoryIds==null || basicCategoryIds.length==0 ) {
			return 0;
		}
		return insurance.getCountByColumnId( basicCategoryIds, flag);
	} 
	
	

	@Override
	public void savePrice(InsurancePriceEntity ipe) {
		insurance.savePrice(ipe);
	}

	@Override
	public void saveProperty(InsurancePropertyEntity insPe) {
		// TODO Auto-generated method stub
		insurance.saveProperty(insPe);
	}

	
	public List<InsuranceEntity> queryByCategory(@Param("webId") int webId, @Param("basicCategoryIds") int[] basicCategoryIds,
			@Param("flag") String flag, @Param("noFlag") String noFlag, @Param("orderBy") String orderBy,
			@Param("order") boolean order, @Param("article") InsuranceEntity article){
		return insurance.queryByCategory(webId, basicCategoryIds, flag, noFlag, orderBy, order, article);
	}
	public void updateStatus(@Param("ids") int[] ids,int status){
		 insurance.updateStatus(ids, status);
		
	}

}
